using System;

namespace SpoolFileLibrary.Reader.Winspool {
    public class DitherType {
        private readonly DitherTypeKind ditherTypeKind;
        private readonly int ditherTypeValue;

        public DitherType(int value) {
            this.ditherTypeValue = value;
            if(value >= 0x00000100) {
                this.ditherTypeKind = DitherTypeKind.Custom;
                return;
            }
            if(!Enum.IsDefined(typeof(DitherTypeKind), value)) {
                return;
            }
            this.ditherTypeKind = (DitherTypeKind) value;
            return;
        }

        public DitherTypeKind DitherTypeKind {
            get { return this.ditherTypeKind; }
        }

        public int DitherTypeValue {
            get { return this.ditherTypeValue; }
        }
    }
}